﻿using System;
using System.Data;
using System.Collections;
using CE.Database;

/// <summary>
/// Summary description for ChinaTaipingProposalDB
/// </summary>
/// 
namespace CE.PersonalAccident
{
    public class ChinaTaipingProposalDB
    {
        public ChinaTaipingProposalDB()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        public Int64 Insert(ChinaTaipingProposal chinataipingproposal)
        {
            MyDatabase _db = new MyDatabase();
            Int64 _result = -1;
            string _spName = "sprocPAProposalInsertUpdateSingleItemChinaTaiping";

            SortedList _sPara = new SortedList();

            #region Parameter
            _sPara.Add("@PAProposalId", chinataipingproposal.PAProposalId);
            _sPara.Add("@PAId", chinataipingproposal.PAId);
            _sPara.Add("@PACompanyId", chinataipingproposal.PACompanyId);
            _sPara.Add("@PAInsId", chinataipingproposal.PAInsId);
            _sPara.Add("@Name", chinataipingproposal.Name);
            _sPara.Add("@PostalCode", chinataipingproposal.PostalCode);
            _sPara.Add("@UnitNo", chinataipingproposal.UnitNo);
            _sPara.Add("@HomeNo", chinataipingproposal.HomeNo);
            _sPara.Add("@Address", chinataipingproposal.Address);
            _sPara.Add("@Gender", chinataipingproposal.Gender);
            _sPara.Add("@NRICNo", chinataipingproposal.NRICNo);
            _sPara.Add("@Nationality", chinataipingproposal.Nationality);
            _sPara.Add("@MobileNo", chinataipingproposal.MobileNo);
            _sPara.Add("@HomePhoneNo", chinataipingproposal.HomePhoneNo);
            _sPara.Add("@OfficePhoneNo", chinataipingproposal.OfficePhoneNo);
            _sPara.Add("@Email", chinataipingproposal.Email);
            _sPara.Add("@SpouseName", chinataipingproposal.SpouseName);
            _sPara.Add("@SpouseGender", chinataipingproposal.SpouseGender);
            _sPara.Add("@SpouseNRICNo", chinataipingproposal.SpouseNRICNo);
            _sPara.Add("@HasPerformManual", chinataipingproposal.HasPerformManual);
            _sPara.Add("@PerformManual", chinataipingproposal.PerformManual);
            _sPara.Add("@HasHazadousHobby", chinataipingproposal.HasHazadousHobby);
            _sPara.Add("@HazadousHobby", chinataipingproposal.HazadousHobby);
            _sPara.Add("@HasPhysicalDefects", chinataipingproposal.HasPhysicalDefects);
            _sPara.Add("@PhysicalDefects", chinataipingproposal.PhysicalDefects);
            _sPara.Add("@HasOtherInsurance", chinataipingproposal.HasOtherInsurance);
            _sPara.Add("@OtherInsuranceCompany", chinataipingproposal.OtherInsuranceCompany);
            _sPara.Add("@OtherInsuranceDetails", chinataipingproposal.OtherInsuranceDetails);
            _sPara.Add("@HasAnyClaimsfromInsurer", chinataipingproposal.HasAnyClaimsfromInsurer);
            _sPara.Add("@AnyClaimsfromInsurer", chinataipingproposal.AnyClaimsfromInsurer);
            _sPara.Add("@HasInsuranceCancelled", chinataipingproposal.HasInsuranceCancelled);
            _sPara.Add("@InsuranceCancelledDetails", chinataipingproposal.InsuranceCancelledDetails);
            _sPara.Add("@PamentType", chinataipingproposal.PamentType);
            _sPara.Add("@RefCEUserId", chinataipingproposal.RefCEUserId);
            _sPara.Add("@ViewedDetailId", chinataipingproposal.ViewedDetailId);
            _sPara.Add("@Status", chinataipingproposal.Status);
            #endregion

            _result = _db.ExecuteSP(_spName, _sPara);

            return _result;
        }

    }
}